class BaseAction:
    def __init__(self, driver):
        self.driver = driver

    # 定位元素基础方法
    def find_login_element(self, feature):
        return self.driver.find_element(feature[0], feature[1])

    # 定位一组元素基础方法
    def find_eles(self):
        pass

    # 点击
    def click(self, element):
        return self.find_login_element(element).click()

    # 输入
    def input(self, element, text):
        return self.find_login_element(element).send_keys(text)

    # 切换frame
    def switch_to_frame(self, frame_feature):
        return self.driver.switch_to.frame(self.find_login_element(frame_feature))

    # 切换回默认frame
    def switch_to_default(self):
        return self.driver.switch_to.default_content()

    # 切换窗口
    def switch_windows(self):
        handles = self.driver.window_handles
        return self.driver.switch_to.window(handles[-1])

    # 判断是否被选中
    def whether_select(self):
        pass

    # 保存截图
    def screenshot(self):
        pass

    # 文本——元素
    def get_test(self, element):
        return self.find_login_element(element).text